//
//  IntroCell.m
//  International_Hospital
//
//  Created by 李建强 on 16/7/8.
//  Copyright © 2016年 LiYiLin. All rights reserved.
//

#import "IntroCell.h"

@interface IntroCell()

@property (nonatomic,strong)UIView *grayView;
@property (nonatomic,strong)UILabel *label;

@property (nonatomic,strong)UIImageView *imageview;
@end




@implementation IntroCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.grayView = [[UIView alloc]init];
        self.grayView.userInteractionEnabled = NO;
        [self.contentView addSubview:self.grayView];
        self.grayView.backgroundColor = [UIColor groupTableViewBackgroundColor];
        self.label = [[UILabel alloc]init];
        [self.contentView addSubview:self.label];
        self.imageview = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jt"]];
        
        
        [self.contentView addSubview:self.imageview];
        
    }
    return self;
}


-(void)layoutSubviews{
    
    [super layoutSubviews];
    [self.grayView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView);
        make.width.mas_equalTo(self.contentView.mas_width);
        make.height.mas_equalTo(10);
        
    }];
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.grayView.mas_bottom).offset(10);
        make.left.equalTo(self.contentView).offset(20);
        
    }];
    
    [self.imageview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-10);
        make.centerY.equalTo(self.contentView.mas_centerY).offset(5);
        make.width.mas_equalTo(self.imageview.frame.size.width);
        make.height.mas_equalTo(self.imageview.frame.size.height);
    }];
    
    
}

-(void)setIndex:(NSInteger)index{
    
    _index = index;
    
    self.label.text = [NSString stringWithFormat:@"医生简介:    第%ld行",self.index];
    
}

    



@end






